//
// Created by liushuai on 2021/1/2.
//

#include "maxSum.h"
int maxSum(std::vector<int>& value){
    int max_value = 0;
    int current_num = 0;
    for(int i=0;i<value.size();i++){
        if(current_num<=0)
            current_num = value[i];
        else
            current_num +=value[i];
        if(current_num>max_value)
            max_value=current_num;
    }
    return max_value;
}